<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.validation.min.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/admincp.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.tooltip.js"></script>
<script type="text/javascript" src="{HEJIN_PATH}public/admin/js/jquery.cookie.js"></script>
<link href="{HEJIN_PATH}public/admin/css/skin_0.css" rel="stylesheet" type="text/css" id="cssfile2" />
<link href="{HEJIN_PATH}public/admin/css/style.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="{HEJIN_PATH}public/jscolor/jscolor.js"></script>
<link href="{HEJIN_PATH}public/datetimepicker/jquery.datetimepicker.css" rel="stylesheet" type="text/css"></link>
<script src="{HEJIN_PATH}public/datetimepicker/jquery.datetimepicker.js" type="text/javascript"></script>

<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
<div class="h3" style="width:auto;"><!--{eval echo strip_tags(stripslashes($zpinfo['zpname']));}--> {lang hejin_toupiao:zpgl}</div>
      <ul class="tab-base">
        <li><a href="admin.php?action=plugins&operation=config&do={$_GET['do']}&identifier=hejin_toupiao&pmod=toupiao&model=zuopinsh&vid=$zpinfo['vid']"><span>{lang hejin_toupiao:cszuopinsh}</span></a></li>
        <li><a href="admin.php?action=plugins&operation=config&do={$_GET['do']}&identifier=hejin_toupiao&pmod=toupiao&model=zuopindsh&vid=$zpinfo['vid']"><span>{lang hejin_toupiao:cszuopinwsh}</span></a></li>
		
      </ul>
    </div>
  </div>
  <form id="add_form" method="post" enctype="multipart/form-data" action="">
    <input type="hidden" name="formhash" value="{FORMHASH}" />
    <input type="hidden" name="zid" value="$zpinfo['id']" />
    <input type="hidden" name="vid" value="$zpinfo['vid']" />
    <table class="table tb-type2">
      <tbody>
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_zpname">{lang hejin_toupiao:zpxming}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<!--{eval echo strip_tags(stripslashes($zpinfo['zpname']));}-->" name="zpname" id="class_zpname" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>
        
        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_telphone">{lang hejin_toupiao:lianxidh}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="<!--{eval echo strip_tags(stripslashes($zpinfo['telphone']));}-->" name="telphone" id="class_telphone" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>
        
        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_content">{lang hejin_toupiao:miaoshu}</label></td>
        </tr>

        <tr class="noborder">
          <td class="vatop rowform"><textarea name="content"><!--{eval echo strip_tags(stripslashes($zpinfo['content']));}--></textarea></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_name">{lang hejin_toupiao:zppic}</label></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><span style="color:#F00">{lang hejin_toupiao:picsctsa}</span></td>
        </tr>
        <tr class="noborder">
          <td colspan="2" class="vatop tips"><span style="color:#F00; font-weight:bolder;">{lang hejin_toupiao:picsctsb}</span> <a href="http://tietuku.com/" target="_blank">{lang hejin_toupiao:picsctsc}</a></td>
        </tr>
         <tr class="noborder">
          <td colspan="2" class="vatop tips"><span style="color:#F00; font-weight:bolder;">{lang hejin_toupiao:picsctsd}</span> <a href="http://tietuku.com/" target="_blank">{lang hejin_toupiao:picsctsc}</a></td>
        </tr>
       

        <tr class="noborder">
          <td class="vatop rowform">{if $zpinfo['pica']}<span class="type-file-show"> <img class="show_image" src="{HEJIN_PATH}public/admin/images/preview.png">
            <div class="type-file-preview">
            {if strpos($zpinfo['pica'], '://')==false}
                            <img src="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['pica']);}-->" width="150">
                         {else}
                         <img src="<!--{eval echo stripslashes($zpinfo['pica']);}-->" width="150">
                         {/if}
                          </div>
            </span>{/if}<span class="type-file-box">
            <input name="pica" type="text" value="<!--{eval echo stripslashes($zpinfo['pica']);}-->" id="class_pica" class="txt">
            </span></td>
          <td class="vatop tips">{if (strpos($zpinfo['pica'], '://')==false) && $zpinfo['pica']}<a href="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['pica']);}-->" target="_blank">{lang hejin_toupiao:picsctse}</a>{/if}</td>
        </tr>

        <tr class="noborder">
          <td class="vatop rowform">{if $zpinfo['picb']}<span class="type-file-show"> <img class="show_image" src="{HEJIN_PATH}public/admin/images/preview.png">
            <div class="type-file-preview">
            {if strpos($zpinfo['picb'], '://')==false}
                            <img src="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['picb']);}-->" width="150">
                         {else}
                         <img src="<!--{eval echo stripslashes($zpinfo['picb']);}-->" width="150">
                         {/if}
                          </div>
            </span>{/if}<span class="type-file-box">
            <input name="picb" type="text" value="<!--{eval echo stripslashes($zpinfo['picb']);}-->" id="class_picb" class="txt">
            </span></td>
          <td class="vatop tips">{if (strpos($zpinfo['picb'], '://')==false) && $zpinfo['picb']}<a href="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['picb']);}-->" target="_blank">{lang hejin_toupiao:picsctse}</a>{/if}</td>
        </tr>

        <tr class="noborder">
          <td class="vatop rowform">{if $zpinfo['picc']}<span class="type-file-show"> <img class="show_image" src="{HEJIN_PATH}public/admin/images/preview.png">
            <div class="type-file-preview">
            {if strpos($zpinfo['picc'], '://')==false}
                            <img src="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['picc']);}-->" width="150">
                         {else}
                         <img src="<!--{eval echo stripslashes($zpinfo['picc']);}-->" width="150">
                         {/if}
                          </div>
            </span>{/if}<span class="type-file-box">
           <input name="picc" type="text" value="<!--{eval echo stripslashes($zpinfo['picc']);}-->" id="class_picc" class="txt">
            </span></td>
          <td class="vatop tips">{if (strpos($zpinfo['picc'], '://')==false) && $zpinfo['picc']}<a href="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['picc']);}-->" target="_blank">{lang hejin_toupiao:picsctse}</a>{/if}</td>
        </tr>

        <tr class="noborder">
          <td class="vatop rowform">{if $zpinfo['picd']}<span class="type-file-show"> <img class="show_image" src="{HEJIN_PATH}public/admin/images/preview.png">
            <div class="type-file-preview">
            {if strpos($zpinfo['picd'], '://')==false}
                            <img src="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['picd']);}-->" width="150">
                         {else}
                         <img src="<!--{eval echo stripslashes($zpinfo['picd']);}-->" width="150">
                         {/if}
                          </div>
            </span>{/if}<span class="type-file-box">
            <input name="picd" type="text" value="<!--{eval echo stripslashes($zpinfo['picd']);}-->" id="class_picd" class="txt">
            </span></td>
          <td class="vatop tips">{if (strpos($zpinfo['picd'], '://')==false) && $zpinfo['picd']}<a href="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['picd']);}-->" target="_blank">{lang hejin_toupiao:picsctse}</a>{/if}</td>
        </tr>
		<tr class="noborder">
          <td class="vatop rowform">{if $zpinfo['pice']}<span class="type-file-show"> <img class="show_image" src="{HEJIN_PATH}public/admin/images/preview.png">
            <div class="type-file-preview">
            {if strpos($zpinfo['pice'], '://')==false}
                            <img src="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['pice']);}-->" width="150">
                         {else}
                         <img src="<!--{eval echo stripslashes($zpinfo['pice']);}-->" width="150">
                         {/if}
                          </div>
            </span>{/if}<span class="type-file-box">
           <input name="pice" type="text" value="<!--{eval echo stripslashes($zpinfo['pice']);}-->" id="class_pice" class="txt">
            </span></td>
          <td class="vatop tips">{if (strpos($zpinfo['pice'], '://')==false) && $zpinfo['pice']}<a href="{HEJIN_PATH}<!--{eval echo stripslashes($zpinfo['pice']);}-->" target="_blank">{lang hejin_toupiao:picsctse}</a>{/if}</td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_liulans">{lang hejin_toupiao:clicknuba}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><input type="text" value="$zpinfo['liulans']" name="liulans" id="class_liulans" class="txt"></td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label class="validation" for="test_toupiaos">{lang hejin_toupiao:votenuba}</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">{if $toupiaosz}{$zpinfo['toupiaos']}&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#F00">{lang hejin_toupiao:yynklqx}</span>{else}<input type="text" value="$zpinfo['toupiaos']" name="toupiaos" id="class_toupiaos" class="txt">{/if}</td>
          <td class="vatop tips"></td>
        </tr>

        <tr class="noborder">
          <td colspan="2" class="required"><label for="test_yuliuc">{lang hejin_toupiao:yuliuc}</label></td>
        </tr>
<tr class="noborder">
        <td class="vatop rowform"><textarea id="yuliuc" name="yuliuc" style="width:700px;height:300px;visibility:hidden;"><!--{eval echo stripslashes($zpinfo['yuliuc']);}--></textarea>
<script src="{HEJIN_PATH}public/kindeditor/kindeditor-min.js" charset="utf-8"></script>
<script src="{HEJIN_PATH}public/kindeditor/lang/zh_CN.js" charset="utf-8"></script>
<script>
	var KE;
  KindEditor.ready(function(K) {
        KE = K.create("textarea[name='yuliuc']", {
						items : ['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
            'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
            'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
            'superscript', '|', 'selectall', 'clearhtml','quickformat','|',
            'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
            'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about'],
						cssPath : "{HEJIN_PATH}public/kindeditor/themes/default/default.css",
						allowImageUpload : false,
						allowFlashUpload : false,
						allowMediaUpload : false,
						allowFileManager : false,
						filterMode: false,
						syncType:"form",
						afterCreate : function() {
							var self = this;
							self.sync();
						},
						afterChange : function() {
							var self = this;
							self.sync();
						},
						afterBlur : function() {
							var self = this;
							self.sync();
						}
        });
			KE.appendHtml = function(id,val) {
				this.html(this.html() + val);
				if (this.isCreated) {
					var cmd = this.cmd;
					cmd.range.selectNodeContents(cmd.doc.body).collapse(false);
					cmd.select();
				}
				return this;
			}
	});
</script>
	</td>
          
          <td class="vatop tips"></td>
        </tr>


      </tbody>
      <tfoot>
        <tr>
          <td colspan="2"><input name="edit_zp" class="btn" type="submit" value="{lang hejin_toupiao:baocun}" /></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>
<script type="text/javascript">
$(document).ready(function(){





    $("#submit").click(function(){
        $("#add_form").submit();
    });

    $("input[nc_type='microshop_goods_class_image']").live("change", function(){
		var src = getFullPath($(this)[0]);
		$(this).parent().prev().find('.low_source').attr('src',src);
		$(this).parent().find('input[class="type-file-text"]').val($(this).val());
	});


    $('#add_form').validate({
        errorPlacement: function(error, element){
            error.appendTo(element.parent().parent().prev().find('td:first'));
        },
        success: function(label){
            label.addClass('valid');
        },
        rules : {
            zpname: {
                required : true,
                maxlength : 1000
            },
            toupiaos: {
                required : true,
                digits: true,
            },
            liulans: {
                required : true,
                digits: true,
            },
            yuliuc: {
                maxlength : 1000
            },
        },
        messages : {
            zpname: {
                required : "{lang hejin_toupiao:addstmsga}",
                maxlength : jQuery.validator.format("{lang hejin_toupiao:addstmsgb}255")
            },
            toupiaos: {
                required : "{lang hejin_toupiao:addstmsga}",
                digits: "{lang hejin_toupiao:addstmsgf}",
            },
            liulans: {
                required : "{lang hejin_toupiao:addstmsga}",
                digits: "{lang hejin_toupiao:addstmsgf}",
            },
            yuliuc: {
                required : "{lang hejin_toupiao:addstmsga}",
                maxlength : jQuery.validator.format("{lang hejin_toupiao:addstmsgb}1000")
            },
        }
    });
});
</script> 
